package classes_tables;

import java.sql.ResultSet;
import java.sql.SQLException;

import projet.Traitement;

public class User implements Table {

	private String login;
	private String pass;
	private String role;


	public User(String login, String pass)
	{
		Traitement t = new Traitement("root","");
		try{
			ResultSet res = t.execRequete("select * from user where login='"+login+"' and pass='"+pass+"' ");
			while(res.next())
			{
				this.login = res.getString("login");
				this.pass  = res.getString("pass");
				this.role  = res.getString("role");
			}
			t.close();
		}
		catch(SQLException e) {e.printStackTrace();}
		
	}
	
	
	@Override
	public String[] getValeurs() {
		
		String[] s = new String[]{login, pass, role};
		
		return s;
	}
	
	
	
	public String getLogin() {
		return login;
	}


	public String getPass() {
		return pass;
	}


	public String getRole() {
		return role;
	}

}
